home *** CD-ROM | disk | FTP | other *** search
Wrap
/* v2.00 Merge Marko Seppänen marko.seppanen@wwnet.fi */ address IMAGEENGINEER Options results signal on error /* Setup a place for errors to go */ if arg()=0 then exit x=arg(1) parse var x pic sec valign halign xoffset yoffset . if halign == "" then do GET PRIMARY pic=result GET SECONDARY sec=result if sec=="" then do 'REQUEST "Choose a SECONDARY image!" "OK"' exit end end else MARK sec SECONDARY MARK pic PRIMARY PROJECT_INFO pic WIDTH picwidth=result PROJECT_INFO pic HEIGHT picheight=result PROJECT_INFO pic ZOOM origzoomval=result PROJECT_INFO sec WIDTH secwidth=result PROJECT_INFO sec HEIGHT secheight=result PROJECT_INFO sec ZOOM seczoomval=result if halign="" then do if exists("ie:prefs/vemerge.cfg") == "1" then do call open("temp","ie:prefs/vemerge.cfg","R") values=readln("temp") parse var values ok valign halign xoffset yoffset . call close("temp") end else do valign=1 halign=0 xoffset=0 yoffset=0 end 'FORM "Merge" "Use|Cancel"', 'CYCLE,"Vertical align","Above|Top|AbsMiddle|Bottom|Below",'valign'', 'CYCLE,"Horizontal align","LeftSide|Left|Center|Right|RightSide",'halign'', 'INTEGER,"X-offset",'"-"||trunc(picwidth/2)','trunc(picwidth/2)','xoffset',SLIDER', 'INTEGER,"Y-offset",'"-"||trunc(picheight/2)','trunc(picheight/2)','yoffset',SLIDER' values=result parse var values ok valign halign xoffset yoffset . if ok = 0 then exit call open("temp","ie:prefs/vemerge.cfg","W") res=writeln("temp",values) call close("temp") end BRIGHTNESS pic 255 bgcolor=result /* VERTICAL ALIGN */ if valign == "0" | upper(valign) == "ABOVE" then do picY0=0+secheight-yoffset picY1=picY0+picheight secY0=0 secY1=secY0+secheight finalheight=max(picY1,secY1)-min(picY0,secY0) end if valign == "1" | upper(valign) == "TOP" then do if sign(yoffset) == "1" then do picY0=0 picY1=picY0+picheight secY0=yoffset secY1=secY0+secheight end else do secY0=0 secY1=secY0+secheight if yoffset == "0" then picY0=0 else picY0=0-yoffset picY1=picY0+picheight end finalheight=max(picY1,secY1)-min(picY0,secY0) end if valign == "2" | upper(valign) == "ABSMIDDLE" then do if trunc(picheight/2) > trunc(secheight/2)-yoffset then do picY0=0 picY1=picY0+picheight secY0=trunc(picheight/2)-trunc(secheight/2)+yoffset secY1=secY0+secheight end else do secY0=0 secY1=secY0+secheight picY0=trunc(secheight/2)-trunc(picheight/2)-yoffset picY1=picY0+picheight end finalheight=max(picY1,secY1)-min(picY0,secY0) end if valign == "3" | upper(valign) == "BOTTOM" then do if picheight > secheight-yoffset then do picY0=0 picY1=picY0+picheight secY1=picY1+yoffset secY0=secY1-secheight end else do secY0=0 secY1=secheight picY1=secY1-yoffset picY0=picY1-picheight end finalheight=max(picY1,secY1)-min(picY0,secY0) end if valign == "4" | upper(valign) == "BELOW" then do picY0=0 picY1=picheight secY0=picY1+yoffset secY1=secY0+secheight finalheight=max(picY1,secY1)-min(picY0,secY0) end /* HORIZONTAL ALIGN */ if halign == "0" | upper(halign) == "LEFTSIDE" then do picX0=0+secwidth-xoffset picX1=picX0+picwidth secX0=0 secX1=secX0+secwidth finalwidth=max(picX1,secX1)-min(picX0,secX0) end if halign == "1" | upper(halign) == "LEFT" then do if sign(xoffset) == "1" then do picX0=0 picX1=picX0+picwidth secX0=xoffset secX1=secX0+secwidth end else do secX0=0 secX1=secX0+secwidth if xoffset == "0" then picX0=0 else picX0=0-xoffset picX1=picX0+picwidth end finalwidth=max(picX1,secX1)-min(picX0,secX0) end if halign == "2" | upper(halign) == "CENTER" then do if trunc(picwidth/2) > trunc(secwidth/2)-xoffset then do picX0=0 picX1=picX0+picwidth secX0=trunc(picwidth/2)-trunc(secwidth/2)+xoffset secX1=secX0+secwidth end else do secX0=0 secX1=secX0+secwidth picX0=trunc(secwidth/2)-trunc(picwidth/2)-xoffset picX1=picX0+picwidth end finalwidth=max(picX1,secX1)-min(picX0,secX0) end if halign == "3" | upper(halign) == "RIGHT" then do if picwidth > secwidth-xoffset then do picX0=0 picX1=picX0+picwidth secX1=picX1+xoffset secX0=secX1-secwidth end else do secX0=0 secX1=secwidth picX1=secX1-xoffset picX0=picX1-picwidth end finalwidth=max(picX1,secX1)-min(picX0,secX0) end if halign == "4" | upper(halign) == "RIGHTSIDE" then do picX0=0 picX1=picwidth secX0=picX1+xoffset secX1=secX0+secwidth finalwidth=max(picX1,secX1)-min(picX0,secX0) end RESIZE bgcolor finalwidth finalheight TILE rightsizebackground=result CLOSE bgcolor MARK pic PRIMARY MARK rightsizebackground SECONDARY COMPOSITE picX0 picY0 MIN piconplace=result CLOSE rightsizebackground MARK sec PRIMARY MARK piconplace SECONDARY COMPOSITE secX0 secY0 MIN final=result CLOSE piconplace MARK sec SECONDARY exit /*******************************************************************/ /* This is where control goes when an error code is returned by IE */ /* It puts up a message saying what happened and on which line */ /*******************************************************************/ error: if RC=5 then do /* Did the user just cancel us? */ IE_TO_FRONT LAST_ERROR 'REQUEST "'||RESULT||'"' exit end else do IE_TO_FRONT LAST_ERROR 'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!' exit end